<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <title>业绩报告</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="commission.js"></script>
</head>
<body>

<?php
session_start();
$name = $_SESSION['name'];
$id = $_SESSION['userid'];
?>
<nav class="navbar navbar-inverse" role="navigation" style="margin-bottom: 0">
    <div class="container-fluid">
    <div class="navbar-header">
      <span class="navbar-brand">The Commission Program</span>
    </div>

    <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right" style="padding-right: 3%">
            <li><a href=""> 编号:</a></li>
            <li><a href=""><?php echo $id ?></a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right" style="padding-right: 5%">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $name ?><span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="commission.html">退出</a></li>
                </ul>
            </li>
        </ul>
    </div>
    </div>
</nav>

<div class="container-fluid">
    <div id="menu" class="list-group" style="background-color:#EEEEEE;width:16%;height:750px;float:left;">
        <ul class="list-group" style="width: 160px;margin:10em 15%;">
          <a href="submit.php"> <span class="list-group-item" style="text-align:center;">发送电报</span></a>
          <a href="telegram.php"> <span class="list-group-item " style="text-align:center;margin-top:2em;">查询历史电报</span></a>
          <a href="report.php"> <span class="list-group-item active" style="text-align:center;margin-top:2em;">获取业绩报告</span></a>
          <a href="#"> <span class="list-group-item" style="text-align:center;margin-top:2em;">其他待定</span></a>
        </ul>
    </div>
    <div id="content" style="background-color:#787878;height:750px;width:2px;float:left;"></div>
    <div id="content" class="row" style="margin: 6% 4% 1%;width:60%;float:left;">
        <form action="frame.php" target="showframe" method="post">
            <div class="col-lg-3" style="margin-left:0;">
                <select class="form-control" id="getdate" name="getdate">
<?php
session_start();
$id=$_SESSION['userid'];
$conn = new mysqli("localhost", "root", "123", "commission");
if ($conn->connect_error) {
    die("服务器连接失败: " . $conn->connect_error);
}
$result = $conn->query("SELECT date FROM report where id = '".$id."'");
if ($result->num_rows > 0) {
   while($row=$result->fetch_assoc())
    {
?>
                    <option><?php echo $row['date']?></option>
<?php
    }
}
$conn->close();
?>
                </select>
            </div>
            <div class="col-lg-1" style="margin-left:6%;">
                <button type="submit" class="btn btn-primary" style="width:80px;">确定
                </button>
            </div>
        </form>
    </div>
    <div id="content" style="background-color:#787878;height:2px;width:35%;float:left;margin-left: 3%"></div>
    <div id="content" class="row" style=";margin:2% 0;width:74%;float:left;">
        <iframe name="showframe" scrolling="no" width="100%" height="600" frameborder="0"></iframe>
    </div>
</div>
</body>
</html>